<template>
  <div>
    <img class="headerimg"
         src="https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/bannner/1901/learn.png">
    <ul class="ulst">
      <li v-for='item of mineArray'
          :key="item.label"
          @click="itemClick(item)"
          class="mineItem">
        <span class="mineTitle">{{item.label}}</span>
        <i class="cubeic-arrow"></i>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'TobnavMine',
  data () {
    return {
      mineArray: [
        { label: '我的订单' },
        { label: '商品收藏' },
        { label: '店铺关注' },
        { label: '我的足迹' },
        { label: '退出登录', type: 'exit' }
      ]
    }
  },
  methods: {
    itemClick (item) {
      if (item.type == 'exit') {
        this.$store.commit('setToken', '')
        localStorage.removeItem('token')
        this.$router.push({ path: '/login' })
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
.mineItem
  font-size: 14px
  text-align: left
  height: 50px
  line-height: 50px
  padding-left: 5%
  border-bottom: 1px solid #eee
  .mineTitle
    display: inline-block
    width: 90%
.headerimg
  height: 150px
  width: 100%
  background: #FFF
</style>
  